package com.service;

import com.bean.*;
import com.dao.PaperCustomDao;
import com.dao.PaperDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2016/12/23.
 */
@Service
public class PaperService {
    @Autowired
    PaperDao paperDao;
    @Autowired
    PaperCustomDao paperCustomDao;
    public void insertPaperTitle(Paper paper){
        paperDao.insertPaperTitle(paper);
    }

    public List<PaperCustom> getAllPaperMsg(){
        List<PaperCustom> allpapermsg = paperCustomDao.getAllPaperMsg();
        return allpapermsg;
    }
    public List<PaperCustom> getPaperMsgById(Long id){
        List<PaperCustom> papermsg = paperCustomDao.getPaperMsgById(id);
        return papermsg;
    }
    public void updatePaperTeacherId(PaperChoice paperChoice){
        paperDao.updatePaperTeacherId(paperChoice);
    }

    public List<Paper> getPaperByTeacher(Long id){
        List<Paper> getpaperbyteacher= paperDao.getPaperByTeacher(id);
        return getpaperbyteacher;
    }
    //查询paper表中指定id的论文
    public List<Paper> getPaperById(Long id){
        List<Paper> getpapermsgbyid = paperDao.getPaperById(id);
        return getpapermsgbyid;
    }
    //修改paper表中指定id的论文题目
    public void updatePaperTitleById(Paper paper){
        paperDao.updatePaperTitleById(paper);
    }
    //删除指定id的论文信息
    public void delPaperById(Long id){
        paperDao.delPaperById(id);
    }
    public List<Paper> getOptionalPaperTitle(Long teacherid){
        List<Paper> getoptionalpapertitle = paperDao.getOptionalPaperTitle(teacherid);
        return getoptionalpapertitle;
    }
    public List<PaperCustom> getStudentPaperChoice(Long studentId){
        List<PaperCustom> getstudentpaperchoice = paperDao.getStudentPaperChoice(studentId);
        return getstudentpaperchoice;
    }
    public void insertPaperTitleByStudent(Paper paper){
        paperDao.insertPaperTitleByStudent(paper);
    }
    public void updatePaperTitleByStudent(PaperCustom paperCustom){
        paperDao.updatePaperTitleByStudent(paperCustom);
    }
    public List<PaperChoice> getTeacherIdByStudent(Long studentId){
        List<PaperChoice> teacherid = paperDao.getTeacherIdByStudent(studentId);
        return teacherid;
    }
    public void delPaperTitleByStudent(Long studentId){
        paperDao.delPaperTitleByStudent(studentId);
    }
    public void updatePaperTitle(PaperChoice paperChoice){
        paperDao.updatePaperTitle(paperChoice);
    }
    public void updateReviewAndGrade(PaperChoice paperChoice){
        paperDao.updateReviewAndGrade(paperChoice);
    }
    public void updatePaperReview(Paper paper){
        paperDao.updatePaperReview(paper);
    }
    public List<PaperChoice> getTitleId(Long paperchoiceid){
        List<PaperChoice> titleId = paperDao.getTitleId(paperchoiceid);
        return titleId;
    }
    public void insertStudentIdAndTeacherId(PaperChoice paperChoice){
        paperDao.insertStudentIdAndTeacherId(paperChoice);
    }
    public List<PaperCustom> getNotChoicePaperStudent(){
        List<PaperCustom> notchoicepaperstudentlist = paperCustomDao.getNotChoicePaperStudent();
        return notchoicepaperstudentlist;
    }
    public List<Student> getStudentByChoiceId(Long choiceid){
        List<Student> student = paperDao.getStudentByChoiceId(choiceid);
        return student;
    }
    public void updatePaperTeacherByStudent(PaperCustom paperCustom){
        paperDao.updatePaperTeacherByStudent(paperCustom);
    }
    public List<PaperCustom> getChoicePaperStudentByTeacher(Long teacherid){
        List<PaperCustom> student = paperCustomDao.getChoicePaperStudentByTeacher(teacherid);
        return student;
    }
    public List<PaperCustom> getNotChoicePaperStudentByTeacher(Long teacherid){
        List<PaperCustom> student = paperCustomDao.getNotChoicePaperStudentByTeacher(teacherid);
        return student;
    }
    public List<PaperCustom> getStudentNotPaperChoice(Long studentid){
        List<PaperCustom> student = paperCustomDao.getStudentNotPaperChoice(studentid);
        return student;
    }
    public Long getChoicedPaper(Long studentId){
        Long list = paperDao.getChoicedPaper(studentId);
        return  list;
    }
    public List<Paper> getAllPaperTitle(Long studentId){
        List<Paper> papertitle = paperDao.getAllPaperTitle(studentId);
        return  papertitle;
    }
    public List<Paper> getTitleByStudentId(Long studentId){
        List<Paper> title = paperDao.getTitleByStudentId(studentId);
        return title;
    }
    public void updatePaper(Paper paper){
        paperDao.updatePaper(paper);
    }
    public List<PaperChoice> getTitleIdByStudentId(Long studentId){
        List<PaperChoice> titleid = paperDao.getTitleIdByStudentId(studentId);
        return titleid;
    }
    public List<Paper> getPaperByStudentId(Long studentId){
        List<Paper> paper = paperDao.getPaperByStudentId(studentId);
        return paper;
    }
}
